﻿<!-- #include file="mymin.asp" -->
<card title="帖子编辑"><p>
<%

dim p,id,a,title,content,rs
' p=getN("p",1)
' if p<1 then p=1

id=getN("id",0)
a=getN("a",0)

if a=0 then
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select title,content from 74hu_topic where id="&id,myconn,1,1
	If Not rs.eof Then
		w "标题:<input name='title"&time_r&"' value='"&nowml(rs("title"))&"'/><br/>"&_
			"内容:<input name='content"&time_r&"' value='"&nowml(rs("content"))&"'/><br/>"&_
			"<anchor>保存帖子<go href=""editpost.asp?sid="&sid&"&amp;id="&id&"&amp;a=1"" method='post'>"&_
			"<postfield name='title' value='$(title"&time_r&")'/>"&_
			"<postfield name='content' value='$(content"&time_r&")'/>"&_
			"</go></anchor>"
	Else
		w "暂时没有帖子！"
	end if
	rs.close
	set rs=nothing
else
	title=getD("title","")
	content=getD("content","")
	if title="" or content="" then call error("帖子标题或内容不能为空!")
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select title,content,edittime from 74hu_topic where id="&id,myconn,1,3
	If Not rs.eof Then
		rs("title")=title
		rs("content")=content
		rs("edittime")=time_now
		rs.update
		w "帖子编辑成功!<a href='post.asp?sid="&sid&"&amp;id="&id&"'>查看帖子</a>"
	Else
		w "帖子已被删除！"
	end if
	rs.close
	set rs=nothing
end if
w "<br/>----------<br/><a href=""posts.asp?sid="&sid&""">[全部帖子]</a>"

call bbsLast
%>